package com.leyou.order.controller;

import com.leyou.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PayController {

    @Autowired
    private OrderService orderService;

    /**
     * 微信回调通知处理器  键值对结构的数据 pojo=map       json=xml    mime类型 浏览器识别的类型
     */
    @PostMapping(value = "/pay/wx/notify", produces="application/xml")
    public Map<String, String> wxNotify(@RequestBody Map<String, String> wxParams){
        Map<String, String> result = orderService.wxNotify(wxParams);
        return result;
    }

}
